Skip to content

feat(bridge): forward reaction webhook events#129

Merged
jack-arturo merged 2 commits into
mainfrom
feat/reaction-webhook-events
Jun 8, 2026
Merged

feat(bridge): forward reaction webhook events#129
jack-arturo merged 2 commits into
mainfrom
feat/reaction-webhook-events

Conversation

@jack-arturo

Copy link
Copy Markdown
Member

Summary

  • Forward inbound WhatsApp reactions to WEBHOOK_URL as typed eventType: "reaction" webhook payloads.
  • Preserve PR feat: capture inbound reactions and add /api/react endpoint #108 persistence behavior: reaction emoji stays in content, target message ID stays in filename / reactionToMessageId.
  • Document the reaction webhook payload, including empty-emoji removal events.

Behavior

  • Reaction add: reactionEmoji and content contain the emoji, reactionRemoved: false.
  • Reaction removal: reactionEmoji and content are empty strings, reactionRemoved: true.
  • Self-authored reactions honor the existing FORWARD_SELF setting.

Tests

  • cd whatsapp-bridge && go test -count=1 ./...
  • cd whatsapp-bridge && golangci-lint run
  • git diff --check
  • Live local add/remove reaction test with AutoHub webhook receiver: both events reached AutoHub as Reaction webhook received; no normal assistant reply path was triggered.

Companion

  • AutoHub receiver PR follows separately and consumes this typed payload.

Copilot AI review requested due to automatic review settings June 8, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds forwarding of inbound WhatsApp reaction events to the configured webhook endpoint as a typed webhook payload (eventType: "reaction"), while preserving the existing persistence semantics introduced in PR #108 (emoji in content, reacted-to message ID in filename / reactionToMessageId).

Changes:

  • Extend the webhook payload schema to support typed reaction events (eventType, reactionToMessageId, reactionEmoji, reactionRemoved) and add a dedicated SendReactionWebhook helper.
  • Update message handling to forward inbound reactions to the webhook (including empty-emoji removal events) while honoring FORWARD_SELF.
  • Add tests validating reaction webhook forwarding behavior (add, removal, self-forwarding disabled, and “no key” ignored) and document the reaction webhook payload in the README.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
whatsapp-bridge/webhook.go Adds reaction-specific fields to the webhook payload and introduces SendReactionWebhook.
whatsapp-bridge/main.go Forwards inbound reactions to the webhook after persisting them, respecting FORWARD_SELF.
whatsapp-bridge/main_test.go Adds end-to-end tests ensuring reaction webhook forwarding works for add/remove and respects forward/self and missing-key behavior.
README.md Documents the typed reaction webhook payload shape and removal semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jack-arturo jack-arturo merged commit 22a03c2 into main Jun 8, 2026
11 checks passed
@jack-arturo jack-arturo deleted the feat/reaction-webhook-events branch June 8, 2026 21:24
meharpreetsingh added a commit to meharpreetsingh/whatsapp-mcp that referenced this pull request Jun 9, 2026
Brings in:
- fix(bridge): bump whatsmeow so WhatsApp accepts new device pairing (verygoodplugins#128)
- feat: capture inbound reactions and add /api/react endpoint (verygoodplugins#108)
- feat(bridge): forward reaction webhook events (verygoodplugins#129)
- chore(deps): bump starlette from 0.49.1 to 1.0.1 (verygoodplugins#124)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants